home *** CD-ROM | disk | FTP | other *** search
/ cyber.net interactivo 1997 March / inter@ivo 1997-03.iso / cybint14 / bin / shared.dxr / 00900_interactivo.ls next >
Encoding:
Text File  |  1997-02-17  |  3.9 KB  |  201 lines

  1. on initGlobals
  2.   global active
  3.   set active to 0
  4. end
  5.  
  6. on wait time
  7.   startTimer()
  8.   repeat while the timer < (time * 20)
  9.     nothing()
  10.   end repeat
  11. end
  12.  
  13. on HotSpots first, last, som, cur
  14.   set already to 0
  15.   set check to 0
  16.   set sense to first + ((last - first + 1) / 2)
  17.   set middle to sense
  18.   set hot to first
  19.   set cold to first
  20.   repeat while sense <= last
  21.     if rollOver(sense) then
  22.       if the visible of sprite hot = 1 then
  23.         set already to 1
  24.       end if
  25.       set check to 1
  26.       if (som <> 0) and (already = 0) then
  27.         sound playFile 2, som
  28.       end if
  29.       set the visible of sprite hot to 1
  30.       exit repeat
  31.     else
  32.       set the visible of sprite hot to 0
  33.     end if
  34.     set hot to hot + 1
  35.     set sense to sense + 1
  36.   end repeat
  37.   if check = 1 then
  38.     repeat while cold < middle
  39.       if cold <> hot then
  40.         set the visible of sprite cold to 0
  41.       end if
  42.       set cold to cold + 1
  43.     end repeat
  44.     cursor([901, 902])
  45.   else
  46.     cursor(-1)
  47.   end if
  48.   if check = 1 then
  49.     return 1
  50.   else
  51.     return 0
  52.   end if
  53. end
  54.  
  55. on hotBlinks first, last, cur
  56.   set check to 0
  57.   set sense to first + ((last - first + 1) / 2)
  58.   set middle to sense
  59.   set hot to first
  60.   set cold to first
  61.   set blink to first
  62.   repeat while sense <= last
  63.     if rollOver(sense) then
  64.       set check to 1
  65.       set the visible of sprite hot to 1
  66.       exit repeat
  67.     end if
  68.     set hot to hot + 1
  69.     set sense to sense + 1
  70.   end repeat
  71.   if check = 1 then
  72.     repeat while cold < middle
  73.       if cold <> hot then
  74.         set the visible of sprite cold to 0
  75.       end if
  76.       set cold to cold + 1
  77.     end repeat
  78.     cursor([901, 902])
  79.   else
  80.     repeat while blink < middle
  81.       if the visible of sprite blink = 1 then
  82.         set the visible of sprite blink to 0
  83.         if blink = (middle - 1) then
  84.           set the visible of sprite first to 1
  85.         else
  86.           set the visible of sprite (blink + 1) to 1
  87.         end if
  88.         exit repeat
  89.       end if
  90.       set blink to blink + 1
  91.     end repeat
  92.     cursor(-1)
  93.   end if
  94.   if check = 1 then
  95.     return 1
  96.   else
  97.     return 0
  98.   end if
  99. end
  100.  
  101. on somBlinks first, last, som, cur
  102.   global active
  103.   set local to the mouseCast
  104.   if hotBlinks(first, last, cur) = 1 then
  105.     if active = 0 then
  106.       sound playFile 2, som
  107.       set active to 1
  108.     end if
  109.     if the mouseCast <> local then
  110.       sound playFile 2, som
  111.     end if
  112.   else
  113.     set active to 0
  114.   end if
  115.   Loopframe()
  116. end
  117.  
  118. on InVis first, last
  119.   set cont to first
  120.   if last = 0 then
  121.     set the visible of sprite cont to 0
  122.   else
  123.     repeat while cont <= last
  124.       set the visible of sprite cont to 0
  125.       set cont to cont + 1
  126.     end repeat
  127.   end if
  128. end
  129.  
  130. on onVis first, last
  131.   set cont to first
  132.   if last = 0 then
  133.     set the visible of sprite cont to 1
  134.   else
  135.     repeat while cont <= last
  136.       set the visible of sprite cont to 1
  137.       set cont to cont + 1
  138.     end repeat
  139.   end if
  140. end
  141.  
  142. on Loopframe
  143.   updateStage()
  144.   go(the frame)
  145. end
  146.  
  147. on videoButton vidsprite, vidframe
  148.   sound stop 1
  149.   sound stop 2
  150.   set the visible of sprite vidsprite to 1
  151.   go(vidframe)
  152. end
  153.  
  154. on videoInit vidsprite, vidcast
  155.   set the startTime of sprite vidsprite to 0
  156.   set the sound of cast vidcast to 1
  157. end
  158.  
  159. on videoLoop vidsprite, vidcast
  160.   if the movieTime of sprite vidsprite = the duration of cast vidcast then
  161.     set the sound of cast vidcast to 0
  162.     set the visible of sprite vidsprite to 0
  163.     updateStage()
  164.     go(the frame + 1)
  165.   else
  166.     go(the frame)
  167.   end if
  168. end
  169.  
  170. on videoClick vidsprite, vidcast
  171.   set the sound of cast vidcast to 0
  172.   set the visible of sprite vidsprite to 0
  173.   updateStage()
  174.   go(the frame + 1)
  175. end
  176.  
  177. on videoExit backframe
  178.   updateStage()
  179.   go(backframe)
  180. end
  181.  
  182. on startNext first, last
  183.   global present
  184.   set the visible of sprite first to 1
  185.   set present to first
  186. end
  187.  
  188. on next
  189.   global present
  190.   set present to present + 1
  191.   set the visible of sprite present to 1
  192. end
  193.  
  194. on checkVis checked
  195.   if the visible of sprite checked = 1 then
  196.     return 1
  197.   else
  198.     return 0
  199.   end if
  200. end
  201.